package com.eduhzy.ttw.commonsdk.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.AbstractExpandableItem;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * @author xubo
 * @date 2018/8/13 15:19
 */
public class SignUp1ParentData extends AbstractExpandableItem<SignUp1SonData> implements Parcelable,MultiItemEntity {

    /**
     * classifyId : 0
     * classifyName : 小学数学一上
     * id : 2785
     * parentId : 0
     * researchId : 745
     * sonList : [{"classifyId":0,"classifyName":"一、准备课","id":2786,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"二、位置","id":2787,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"三、1~5的认识和加减法","id":2788,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"四、认识图形（一）","id":2789,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"五、6~10的认识和加减法","id":2790,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"六、11~20各数的认识","id":2791,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"七、认识钟表","id":2792,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"八、20以内的进位加法","id":2793,"parentId":2785,"researchId":745},{"classifyId":0,"classifyName":"九、总复习","id":2794,"parentId":2785,"researchId":745}]
     * sonNum : 9
     */

    private int classifyId;
    private String classifyName;
    private int id;
    private int parentId;
    private int researchId;
    private int sonNum;
    @SerializedName("sonList")
    private List<SignUp1SonData> sonList;

    @Override
    public List<SignUp1SonData> getSubItems() {
        return getSonList();
    }

    public int getClassifyId() {
        return classifyId;
    }

    public void setClassifyId(int classifyId) {
        this.classifyId = classifyId;
    }

    public String getClassifyName() {
        return classifyName;
    }

    public void setClassifyName(String classifyName) {
        this.classifyName = classifyName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public int getResearchId() {
        return researchId;
    }

    public void setResearchId(int researchId) {
        this.researchId = researchId;
    }

    public int getSonNum() {
        return sonNum;
    }

    public void setSonNum(int sonNum) {
        this.sonNum = sonNum;
    }

    public List<SignUp1SonData> getSonList() {
        return sonList;
    }

    public void setSonList(List<SignUp1SonData> sonList) {
        this.sonList = sonList;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.classifyId);
        dest.writeString(this.classifyName);
        dest.writeInt(this.id);
        dest.writeInt(this.parentId);
        dest.writeInt(this.researchId);
        dest.writeInt(this.sonNum);
        dest.writeTypedList(this.sonList);
    }

    public SignUp1ParentData() {
    }

    protected SignUp1ParentData(Parcel in) {
        this.classifyId = in.readInt();
        this.classifyName = in.readString();
        this.id = in.readInt();
        this.parentId = in.readInt();
        this.researchId = in.readInt();
        this.sonNum = in.readInt();
        this.sonList = in.createTypedArrayList(SignUp1SonData.CREATOR);
    }

    public static final Creator<SignUp1ParentData> CREATOR = new Creator<SignUp1ParentData>() {
        @Override
        public SignUp1ParentData createFromParcel(Parcel source) {
            return new SignUp1ParentData(source);
        }

        @Override
        public SignUp1ParentData[] newArray(int size) {
            return new SignUp1ParentData[size];
        }
    };

    @Override
    public int getLevel() {
        return 0;
    }

    @Override
    public int getItemType() {
        return 0;
    }
}
